#include <algorithm>
#include <functional>
#include <iostream>
#include <vector>

using namespace std;

class Function_object {
public:
  int operator()(int a) { return 2 * a; }
};

int add(int a) { return a += 1; }

int main() {
  vector<function<int(int)>> vec;
  vec.emplace_back(add);
  vec.emplace_back(Function_object());

  // for (auto it : vec) {
  //   cout << it(5) << endl;
  // }

  for (auto it = vec.begin(); it != vec.end(); ++it) {
    cout << (*it)(5) << endl;
  }

  return 0;
}